package com.flute.framework.monitor;

public class ComparableValue {
	private String value;

	public enum ResultType {
		Bigger, Smaller, Equals
	}

	private ResultType type;

	public ComparableValue(String value) {
		this.value = value;
		this.type = ResultType.Equals;
	}

	public ResultType getType() {
		return type;
	}

	public void setType(ResultType type) {
		this.type = type;
	}

	public String getValue() {
		return value;
	}

	public void setValue(String value) {
		this.value = value;
	}

	public boolean meet(String value) {
		int cvalue = value.compareTo(this.value);
		if (cvalue > 0) {
			return type == ResultType.Bigger;
		} else if (cvalue == 0) {
			return type == ResultType.Equals;
		} else {
			return type == ResultType.Smaller;
		}
	}
}
